package com.bwf.servlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/6/13 16:18
 * @Copyright 博为峰
 */
@WebServlet("/stu")
public class StudentServlet extends BaseServlet {
    public String list(HttpServletRequest request, HttpServletResponse response) {
//        HttpSession session = request.getSession();
//        String email = (String)session.getAttribute("email");
//        if(email != null && email.equals("zhangsan@163.com")){
        return "forward:/student_list.jsp";
//        }else {
//            return "redirect:/index.jsp";
//        }

    }

    public String add(HttpServletRequest request, HttpServletResponse response) {
//        HttpSession session = request.getSession();
//        String email = (String) session.getAttribute("email");
//        if (email != null && email.equals("zhangsan@163.com")) {
        return "forward:/student_add.jsp";
//        } else {
//            return "redirect:/index.jsp";
//        }
    }
}
